Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS should support TOC hierarchy expressed as (class-less) HTML hierarchy #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

CSS should support TOC hierarchy expressed as (class-less) HTML hierarchy #31

wants to merge 2 commits into from

Conversation

smiley
Copy link

@smiley smiley commented Jan 8, 2018

Guzzle theme's CSS relies on your table of contents to have .toctree-l1, .toctree-l2, .toctree-l3 classes to express hierarchy. For some reason our Sphinx setup didn't generate these classes, but it did express it via simple HTML hierarchy:

<div class="sidebar-toc">
    <ul>
        <li><a class="reference internal" href="#">helplib.base</a>
            <ul>
                <li><a class="reference internal" href="#intro">Intro</a></li>
                <li><a class="reference internal" href="#types">Types</a></li>
                <li><a class="reference internal" href="#functions">Functions</a></li>
            </ul>
        </li>
    </ul>    
</div>

Thus, I added a CSS3 child selector in addition to the existing class selector: (which both our HTML and Guzzle's docs' matches)

.sidebar-toc ul li.toctree-l2 a,
.sidebar-toc > ul > li > ul > li > a {
  padding: 5px 50px;
}

Support TOC hierarchy expressed as (class-less) HTML hierarchy.
Spacing typo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant